<template>
	<view>
		<text>ref响应式</text>
	</view>
	<view>
		{{ i }}
	</view>
	<view>
		<button size="default" type="primary" @click="i++">加一</button>
	</view>
	<view>
		<text>对象响应</text>
		<p>{{ obj.name }}</p>
		<p>{{ obj.age }}</p>
		<!-- obj.arr[1] 15 -->
		<p>{{ obj.arr[1] }}</p>
	</view>
</template>

<script setup>
	import {ref} from "vue"
	var i = ref(1);
	var j = 0;
	const interval = setInterval(()=>{
		i.value++;
		console.log(i.value);
		if(i.value > 10){
			clearInterval(interval)
		}
	},1000)
	const obj = ref({
		name:"zhangsan",
		age:18,
		arr:[1,15]
	})
</script>

<style lang="scss">
	       
</style>
